import 'package:flutter/material.dart';

class ImageAndIconRoute extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    var img = AssetImage("images/avatar.png");
    var textStyle = TextStyle(
        color: Colors.black,
        fontSize: 18.0,
        height: 1.2,
    );

    String icons = "";
    icons += "\uE914";
    icons += "\uE000";
    icons += "\uE90D";
    return Scaffold(
      appBar: AppBar(title: Text("ImageAndIcon"),),
      body: Center(
        child: SingleChildScrollView(
          child: Row(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              Expanded(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  mainAxisSize: MainAxisSize.min,
                  children: <Widget>[
                    Image(
                      image: AssetImage("images/avatar.png"),
                      width: 100.0,
                    ),
                    Image.asset("images/avatar.png", width: 100.0),
                    Image(
                      image: NetworkImage(
                          "http://huajianghu.xin/assets/img/avatar.png"),
                      width: 100.0,
                    ),
                    Image.network("http://huajianghu.xin/assets/img/avatar.png",
                        width: 100.0),
                    Image(
                      image: AssetImage("images/avatar.png"),
                      width: 100.0,
                      color: Colors.blue,
                      colorBlendMode: BlendMode.difference,
                    ),
                    Image(
                      image: AssetImage("images/avatar.png"),
                      width: 100.0,
                      height: 200.0,
                      color: Colors.blue,
                      colorBlendMode: BlendMode.difference,
                      repeat: ImageRepeat.repeatY,
                    ),
                    Text(
                      icons,
                      style: TextStyle(
                        fontFamily: "MaterialIcons",
                        fontSize: 24.0,
                        color: Colors.green,
                      ),
                    ),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: <Widget>[
                        Icon(Icons.accessible, color:Colors.green),
                        Icon(Icons.error, color:Colors.green),
                        Icon(Icons.fingerprint, color:Colors.green),
                      ],
                    ),
                  ],
                ),
              ),
              Expanded(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  mainAxisSize: MainAxisSize.min,
                  children: <Image>[
                    Image(
                      image: img,
                      height: 50.0,
                      width: 100.0,
                      fit: BoxFit.fill,
                    ),
                    Image(
                      image: img,
                      height: 50.0,
                      width: 50.0,
                      fit: BoxFit.contain,
                    ),
                    Image(
                      image: img,
                      height: 100.0,
                      width: 50.0,
                      fit: BoxFit.cover,
                    ),
                    Image(
                      image: img,
                      width: 100.0,
                      height: 50.0,
                      fit: BoxFit.fitWidth,
                    ),
                    Image(
                      image: img,
                      width: 100.0,
                      height: 50.0,
                      fit: BoxFit.fitHeight,
                    ),
                    Image(
                      image: img,
                      width: 100.0,
                      height: 50.0,
                      fit: BoxFit.scaleDown,
                    ),
                    Image(
                      image: img,
                      height: 50.0,
                      width: 100.0,
                      fit: BoxFit.none,
                    ),
                    Image(
                      image: img,
                      width: 100.0,
                      color: Colors.blue,
                      colorBlendMode: BlendMode.difference,
                      fit: BoxFit.fill,
                    ),
                    Image(
                      image: img,
                      width: 100.0,
                      height: 200.0,
                      repeat: ImageRepeat.repeatY ,
                    ),
                  ].map((e) {
                    return Column(
                      children: <Widget>[
                        Padding(
                          padding: EdgeInsets.all(16.0),
                          child: SizedBox(
                            width: 100,
                            child: e,
                          ),
                        ),
                        Text(e.fit.toString(), style: textStyle,),
                      ],
                    );
                  }).toList(),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
